package dom;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.List;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;

public class ParsePom {
	public static void main(String[] args) throws Exception {
		InputStream inputStream = new FileInputStream("pom.xml");
		SAXBuilder builder = new SAXBuilder(false);
		
		Document document = builder.build(inputStream);
		
		Element root = document.getRootElement();
		List<Element> list = root.getChildren();
//		Element dependencies = list.get(8);
//		System.out.println(dependencies.getName());
//		List<Element> dependencyList = dependencies.getChildren();
//		for(Element e:dependencyList){
//			String groupId = e.getChild("groupId").getTextTrim();
//			String artifactId = e.getChild("artifactId").getTextTrim();
//			String version = e.getChild("version").getTextTrim();
//			String scope = e.getChild("scope").getTextTrim();
//			System.out.println(groupId+"\t"+artifactId+"\t"+version+"\t"+scope);
//			
//		}
	}
	
	

}
